package test.day02;

import java.util.Arrays;

public class ArrayDemo {
    public static void main(String[] args) {
        int[] arr1 = {1,2,3,4,5};
        int[] arr2 = new int[]{1,2,3,4,5};
        int[] arr3;
        arr2 = new int[]{1,2,3,4,5};
        int[] arr = new int[10];//默认十个0
        double[] drr = new double[10];//默认十个0.0
        boolean[] brr = new boolean[10];//默认false
        for(int i = 0;i<10;i++){
            System.out.println(brr[i]);
        }

        //下标访问从0开始,arr.length获取数组长度
        System.out.println(arr1[arr1.length-1]);

        for(int i =0; i < arr2.length;i++){
            //arr2[i] = 99;
            System.out.println(arr2[i]);
        }
        System.out.println(Arrays.toString(arr2));//Arrays.toString(数组名)



    }
}
